Liveness-Based Garbage Collection
نویسندگان
چکیده
Current garbage collectors leave much heap-allocated data uncollected because they preserve data reachable from a root set. However, only live data—a subset of reachable data—need be preserved. Using a first-order functional language we formulate a context-sensitive liveness analysis for structured data and prove it correct. We then use a 0-CFA-like conservative approximation to annotate each allocation and function-call program point with a finite-state automaton—which the garbage collector inspects to curtail reachability during marking. As a result, fewer objects are marked (albeit with a more expensive marker) and then preserved (e.g. by a copy phase). Experiments confirm the expected performance benefits—increase in garbage reclaimed and a consequent decrease in the number of collections, a decrease in the memory size required to run programs, and reduced overall garbage collection time for a majority of programs.
منابع مشابه
A Non-blocking Snapshot Algorithm for Distributed Garbage Collection of Mobile Active Objects
Distributed actor garbage collection differs from distributed object garbage collection in that it needs to consider in-transit message detection, unordered message reception, and actor migration. In this paper, we propose a new snapshot-based distributed actor garbage collection algorithm. The algorithm does not require First-In-First-Out or blocking communication, nor message logging. Further...
متن کاملOn the Usefulness of Liveness for Garbage Collection and Leak Detection
The effectiveness of garbage collectors and leak detectors in identifying dead objects depends on the “accuracy” of their reachability traversal. Accuracy has two orthogonal dimensions: (i) whether the reachability traversal can distinguish between pointers and non-pointers (type accuracy), and (ii) whether the reachability traversal can identify memory locations that will be dereferenced in th...
متن کاملSome Key Issues in the Design of Distributed Garbage Collection and References
The design of garbage collectors combines both theoretical aspects (safety and liveness) and practical ones (such as efficiency, inobtrusiveness, ease of implementation, fault tolerance, etc.). Although distributed GC is an instance of a consistency problem, practical designs often use weaker, “conservative” safety conditions, and/or weaker, “incomplete” liveness conditions. We report on our ex...
متن کاملLive-Structure Analysis for Logic Programming Languages with Declarations
Live-structure analysis addresses the problem of memory reuse for logic programs through program analysis rather than by run-time garbage collection. The present paper focuses on pure logic programs with declarations of modes, types, and determinism. The analysis is based on previous work for pure Prolog but introduces important innovations. First, the liveness analysis is extended to consider ...
متن کاملGarbage Collection and Local Variable Type-Precision and Liveness in JavaTM Virtual Machines
Full precision in garbage collection implies retaining only those heap allocated objects that will actually be used in the future. Since full precision is not computable in general, garbage collectors use safe (i.e., conservative) approximations such as reachability from a set of root references. Ambiguous roots collectors (commonly called “conservative”) can be overly conservative because they...
متن کامل